package com.whut.monitor.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author Sandeepin
 * 监测(传感器设备关联)实体-对应数据库表
 */
@Entity
@Table(name = "t_monitor")
public class MonitorEntity {
	private Integer id;
	private String monitorNum;
	private EquipmentEntity equipmentEntity;
	private ChannelEntity channelEntity;
	private SensorEntity sensorEntity;
	private String descrip;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "monitor_num")
	public String getMonitorNum() {
		return monitorNum;
	}

	public void setMonitorNum(String monitorNum) {
		this.monitorNum = monitorNum;
	}

	@ManyToOne
	@JoinColumn(name = "equipment_id")

	public EquipmentEntity getEquipmentEntity() {
		return equipmentEntity;
	}

	public void setEquipmentEntity(EquipmentEntity equipmentEntity) {
		this.equipmentEntity = equipmentEntity;
	}

	@ManyToOne
	@JoinColumn(name = "channel_id")
	public ChannelEntity getChannelEntity() {
		return channelEntity;
	}

	public void setChannelEntity(ChannelEntity channelEntity) {
		this.channelEntity = channelEntity;
	}

	@ManyToOne
	@JoinColumn(name = "sensor_id")
	public SensorEntity getSensorEntity() {
		return sensorEntity;
	}

	public void setSensorEntity(SensorEntity sensorEntity) {
		this.sensorEntity = sensorEntity;
	}

	@Column(name = "descrip")
	public String getDescrip() {
		return descrip;
	}

	public void setDescrip(String descrip) {
		this.descrip = descrip;
	}

}
